
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 java.util.ArrayList,
                 com.scalar.chiptrack.sales.TermsAndConditions,
                 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.sales.SalesOrder,
				 com.scalar.chiptrack.commons.Address,
                 com.scalar.chiptrack.rma.RMALineItem"%>

<% String chipTracContext = "/" + ConfigManager.getChipTracContext(); %>

<% String rmaId = request.getParameter("rmaId"); %>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<style type="text/css">
a { text-decoration : none}
</style>
    
<script language="javaScript">

function showErrorReportPage()
{
    newWindow = window.open ('<%=chipTracContext%>/reportProblem.do','reportProblem','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=750,height=400,resizable=no');
    newWindow.focus();
}

function sendMail(rmaId)
{
  newWindow = window.open ('<%=chipTracContext%>/sendRmaMail.do?rmaId=' + rmaId, 'sendMailPopup1','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=800,height=550,resizable=yes');
}

</script>
</HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">
<html:html>
<html:form name="generateRmaForm" action="/generateRMA.do" method="post" type="com.scalar.chiptrack.rma.forms.RMAForm">

<%  String backgroundImage = ""; %>
<logic:equal name="generateRmaForm" property="rmaStatus" value="CANCELLED" >
    <% backgroundImage = chipTracContext +"/jsp/includes/images/cancelled_icon.gif"; %>
</logic:equal>
<br>
<center>
<logic:equal name="rmaCancel" value="YES" >
    <font class='NArialL'><font color='red'>Are you sure, you want to cancel this RMA Form &nbsp;&nbsp;</font></font>
    <a href='<%= chipTracContext%>/generateRMA.do?action=CancelRMAForm&rmaId=<bean:write name="generateRmaForm" property="rmaId" />&rmaNo=<bean:write name="generateRmaForm" property="rmaNumber" />' onMouseOver="window.status='Cancel This RMA Form';return true" onMouseOut="window.status='';return true">
        <img src='<%=chipTracContext%>/jsp/includes/images/cancel.gif' height='16' width='53' border='0'>
    </a>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a href='<%= chipTracContext%>/generateRMA.do?action=UpdateRMAForm&rmaId=<bean:write name="generateRmaForm" property="rmaId" />' onMouseOver="window.status='RMA Form';return true" onMouseOut="window.status='';return true">
        <img src='<%=chipTracContext%>/jsp/includes/images/back.gif' height='16' width='39' border='0'>
    </a>
</logic:equal>
</center>
<br>
<center><h2>RMA Acknowledgement</h2></center>
<br>
<table width="100%" cellspacing='0' cellpadding='0' border=0 align=center background='<%=backgroundImage%>'>
    <tr>
        <td>
            <P STYLE="page-break-after: always">
            <table width="98%" cellspacing="0" cellpadding="0" border="0" align="center">
                <tr>
                    <td width="34%" align="center"><img src="<%=chipTracContext%>/jsp/includes/images/scalar_logo.jpg" height="72" width='180' border=0></td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td widht="30%" align="center" class="NArialL"><br>
                        <% SalesOrder salesOrder = (SalesOrder)request.getAttribute("salesOrder");%>
                        <%=salesOrder.getClientName()%><br>
                        <%=salesOrder.getClientAddressAsHTML()%>
                        <%//=ConfigManager.getClientAddressLine1()%><%//=ConfigManager.getClientAddressLine2()%><%//=ConfigManager.getClientAddressLine3()%> <%//=ConfigManager.getClientPhone()%> <%//=ConfigManager.getClientFax()%>
                    </td>
                    <td width='1%'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td>
                    <td width="34%" align=center>
                        <font class="NArialW">
                        <table width='80' align=left border='0' background='<%=chipTracContext%>/jsp/includes/images/printer_icon_small.gif'>
                            <tr>
                                <td>
                                    <a href="javascript:window.print();" title='Click here to Print RMA Acknowledgement'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    </a>
                                </td>
                            </tr>
                        </table>
                        <br>
                        <table border ="0" width='5' align=left background='<%=chipTracContext%>/jsp/includes/images/email1.gif'>
                            <tr>
                                <td>
                                    <!--b>[E-mail this Acknowledgement]</b-->
                                    <a href="javascript:sendMail(<%=rmaId%>);" title='Click here to Mail RMA Acknowledgement'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
                                </td>
                            </tr>
                        </table>
                        </font>
                    </td>
                </tr>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
                <tr><td colspan=5><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=5></td></tr>
            </table>
            <br>
            <table  width="95%" border="0" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center">
                <tr>
                    <td colspan="5" class="NArialL">
                        <b><u>NOTE: RMA number is valid for only 30 days from issue date.</u></b>
                    </td>
                </tr>
                <tr><td colspan="5">&nbsp;</td></tr>
                <tr>
                    <td width="30%">
                        <table border=1 width="100%" height="140" bordercolor='#000000' cellspacing='0' cellpadding='0'>
                            <tr height=20><td class="NArialL" bgcolor="#DEE1E2">Ordered By :</td></tr>
                            <tr height=20><td class="NArialL" bgcolor="#FFFFEE">
                                <table width="100%" class="NArialL" height=80 cellspacing='0' cellpadding='0'>
                                    <tr><td><bean:write name="generateRmaForm" property="customerName" />&nbsp;</td></tr>
                                    <tr><td><bean:write name="generateRmaForm" property="addressAsHTML" filter="false"/></td></tr>
                                </table>
                            </td></tr>
                        </table>
                    </td>
                    <td width="5%">&nbsp;</td>
                    <td width="30%">
                        <table border="1" width="100%" height="140" bordercolor='#000000' cellspacing='0' cellpadding='0'>
                            <tr height=20><td class="NArialL" bgcolor="#DEE1E2">Bill To :</td></tr>
                            <tr height=20><td class="NArialL" bgcolor="#FFFFEE">
                                <table width="100%" class="NArialL" height=80 cellspacing='0' cellpadding='0'>
                                    <tr><td><bean:write name="generateRmaForm" property="customerName" /></td></tr>
                                    <tr><td><bean:write name="generateRmaForm" property="addressAsHTML" filter="false"/></td></tr>
                                </table>
                            </td></tr>
                        </table>
                    </td>
                    <td width="5%">&nbsp;</td>
                    <td width="30%">
                        <table border="1" width="100%" height="140" bordercolor='#000000' cellspacing='0' cellpadding='0'>
                            <tr height=20><td class="NArialL" bgcolor="#DEE1E2">Ship To :</td></tr>
                            <tr height=20><td class="NArialL" bgcolor="#FFFFEE">
                                <table width="100%" class="NArialL" height=80 cellspacing='0' cellpadding='0'>
                                    <tr><td><bean:write name="generateRmaForm" property="vendorAddressAsHTML" filter="false"/></td></tr>
                                </table>
                            </td></tr>
                        </table>
                    </td>
                </tr>
                <tr><td colspan="5">&nbsp;</td></tr>
                <tr>
                    <td colspan="5">
                        <table border="1"  width="100%" bordercolor='#000000' cellspacing='0' cellpadding='0' >
                            <tr height=20>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center">RMA Number</td>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center">Contact Person</td>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center"><bean:message key="label.sales.endCustomer"/></td>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center">Issue date</td>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center">Requested Date</td>
                                <td width="15%" class="NArialL" bgcolor="#DEE1E2" align="center">Close Date</td>
                            </tr>
                            <tr height=20>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="rmaNumber" />&nbsp;</td>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="contactPerson" />&nbsp;</td>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="endUser" />&nbsp;</td>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="rmaIssueDate" />&nbsp;</td>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="rmaRequestDate" />&nbsp;</td>
                                <td class="NArialL" bgcolor="#FFFFEE" align="center"><bean:write name="generateRmaForm" property="closeDate" />&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <br><br><br>
            <table width="95%" border="1" bordercolor="#000000" cellspacing="0" cellpadding="0" align="center">
                <tr height=20>
                    <td width="5%" bgcolor='#DEE1E2' class="NArialL" align=center>Line Item # </td>
                    <td width="5%" bgcolor='#DEE1E2'  class="NArialL" align=center>PO Line Item # </td>
                    <td width="15%" bgcolor='#DEE1E2' class="NArialL" align=center><bean:message key="label.mfgPartNumber" /></td>
                    <td width="10%" bgcolor='#DEE1E2' class="NArialL" align=center>PO # </td>
                    <td width="10%" bgcolor='#DEE1E2' class="NArialL" align=center>Sales Order # </td>
                    <td width="10%" bgcolor='#DEE1E2' class="NArialL" align=center>Invoice # </td>
                    <td width="10%" bgcolor='#DEE1E2' class="NArialL" align=center>Invoice Date </td>
                    <td width="10%" bgcolor='#DEE1E2' class="NArialL" align=center>Quantity </td>
                    <td width="25%" bgcolor='#DEE1E2' class="NArialL" align=center>Problem Description </td>
                    <!--
                    <td bgcolor='#DEE1E2' width="7%" class="NArialL" align=center>Price</td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Extended Price</td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Serial # </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Reason For Failure </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Exchange </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Credit </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>FA </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Receive <br>Quantity </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Remarks </td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Close <br> Quantity</td>
                    <td bgcolor='#DEE1E2' class="NArialL" align=center>Close Date</td>
                    -->
                </tr>
                <logic:iterate id="LineItem" name="lineItems" type="com.scalar.chiptrack.rma.RMALineItem">
                <tr height=20>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center"><bean:write name="LineItem" property="lineItemNo"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="poLineItemNo" value="0"><bean:write name="LineItem" property="poLineItemNo"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center" nowrap><bean:write name="LineItem" property="partNumber"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center"><bean:write name="LineItem" property="poNumber"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center"><bean:write name="LineItem" property="salesOrderNumber"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center"><bean:write name="LineItem" property="invoiceNumber"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center"><bean:write name="LineItem" property="invoiceDate"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="quantity" value="0"><bean:write name="LineItem" property="quantity"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="lineItemId" value="-1"><bean:write name="LineItem" property="problemDescriptionAsHTML" filter="false" /></logic:notEqual>&nbsp;
                    </td>
                    <%--<td bgcolor='#FFFFEE'  class="NArialL" align="center">< bean:write name="LineItem" property="serialNumber"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">< bean:write name="LineItem" property="reason"/>&nbsp;</td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="right" valign="center">
                        <logic:notEqual  name="LineItem" property="lineItemId" value="-1"><bean:write name="LineItem" property="unitPriceAsString"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="right">
                        <logic:notEqual  name="LineItem" property="lineItemId" value="-1"><bean:write name="LineItem" property="extendedPriceAsString"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:equal  name="LineItem" property="isExchange" value="true">Yes</logic:equal>
                        <logic:equal  name="LineItem" property="isExchange" value="false">&nbsp;</logic:equal>
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:equal  name="LineItem" property="isCredit" value="true">Yes</logic:equal>
                        <logic:equal  name="LineItem" property="isCredit" value="false">&nbsp;</logic:equal>
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:equal  name="LineItem" property="isFa" value="true">&nbsp;Yes&nbsp;</logic:equal>
                        <logic:equal  name="LineItem" property="isFa" value="false">&nbsp;</logic:equal>
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="receiveQty" value="0"><bean:write name="LineItem" property="receiveQty"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="lineItemId" value="-1"><bean:write name="LineItem" property="remarksAsHTML" filter="false" /></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <logic:notEqual  name="LineItem" property="closeQty" value="0"><bean:write name="LineItem" property="closeQty"/></logic:notEqual>&nbsp;
                    </td>
                    <td bgcolor='#FFFFEE'  class="NArialL" align="center">
                        <bean:write name="LineItem" property="lineItemCloseDate"/>&nbsp;
                    </td>--%>
                </tr>
                </logic:iterate>
            </table>
            </P>
            <table  width="95%" cellspacing='5' cellpadding='0' border=0 align=center>
                <tr><td class="NArialL"><u>Please read carefully:</u></td></tr>
                <%--<tr><td class="NArialL"><li>In order to obtain RMA number, fill out all the above information properly and fax this form to RMA department. We will contact you with your RMA number.</td></tr>--%>
                <tr><td class="NArialL"><li>Please write the RMA number on the outside of your package and include a copy of invoice and shipper to expedite processing time.</td></tr>
                <tr><td class="NArialL"><li>RMA department will refuse any shipments without a valid RMA number.</td></tr>
                <%--<tr><td class="NArialL"><li>All warranties start from the original invoice date.</td></tr>
                <tr><td class="NArialL"><li>For more information on RMA policies please contact sales.</td></tr>--%>
                <tr><td class="NArialL">&nbsp;</td></tr>
                <%--
                <tr>
                      <td width='100%' valign="top" colspan="3" class="viewdata2"><center><b>Terms And Conditions</b></center></td>
                </tr>
                <tr>
                     <td width='100%' valign="top" colspan="3" class="viewdata2"><center>
                     <!-- Modified by Sarada on 5th March 2004 to get client Address -->
                     <% Address address = salesOrder.getClientAddressAsObject(); %>
                     <%=salesOrder.getClientName()%><br>
                     <%=salesOrder.getClientAddressToLoad(address)%>
                     <%//=ConfigManager.getClientAddressLine1()%><br>
                     <%//=ConfigManager.getClientAddressLine2()%><%//=ConfigManager.getClientAddressLine3()%> <%//=ConfigManager.getClientPhone()%> <%//=ConfigManager.getClientFax()%>
                     </center>
                     </td>
                </tr>
                <tr>
                   <td width='100%' colspan="3" class="viewdata1">&nbsp;</td>
                </tr>

                <tr>
                    <%
                        ArrayList list = (ArrayList)request.getAttribute("termsAndConditions");
                        if(list != null)
                        {
                            for(int i=0;i<list.size();i++)
                            {
                                TermsAndConditions terms = (TermsAndConditions)list.get(i);
                    %>
                        <tr>
                            <td bgcolor='#DEE1E2' class="viewdata1"><%=i+1%>. <u><%=terms.getTermsTitle().trim()%></u> <%=terms.getTerms().trim()%></td>
                        </tr>

                    <%
                            }
                        }
                    %>

                </tr>
                --%>
            </table>
        </td>
    </tr>
</table>
</html:form>
</html:html>
</BODY>
</HTML>
